#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

const int maxn=5;

void makeData() {
    FILE *f=fopen("landmine.in", "w");
    fprintf(f, "%d\n", maxn);
    for (int i=1; i<=maxn; i++) fprintf(f, "%d ", (rand()%2 ? -1 : 1)*rand()%10);
    fprintf(f, "\n");
    for (int i=1; i<=maxn; i++) fprintf(f, "%d ", (rand()%2 ? -1 : 1)*rand()%10);
    fprintf(f, "\n");
    for (int i=1; i<=maxn; i++) fprintf(f, "%d ", (rand()%2 ? -1 : 1)*rand()%10);
    fprintf(f, "\n");
    for (int i=1; i<=maxn; i++) fprintf(f, "%d ", (rand()%2 ? -1 : 1)*rand()%10);
    fprintf(f, "\n");
    fclose(f);
}

int main() {
    srand(time(0));
    for (; ; ) {
        makeData();
        if (system("./bin")) {
            printf("RE!\n");
            return -1;
        } else if (system("./check")) {
            printf("CE!\n");
            return -1;
        } else if (system("cmp check.out landmine.out")) {
            printf("WA!\n");
            return -1;
        }
    }
    return 0;
}
